
<div class="row-fluid">
    <div class="span12">
        <div id="pagination" class="btn-group"><?= $pagination ?></div>
    </div>
</div>
<form action="<?= base_url() ?><?= get_segment(1) ?>/<?= get_segment(2) ?>/all" method="post" style="margin-bottom: 5px;" />
<div class="row-fluid">
    <div class="span12">
        <div  class="box corner-all">
            <div class="box-header grd-white corner-top"> <?= $this->lang->line('label_browser') ?> [<?=count($result)?>/<?= $count ?>] </div>

            <div id='box-body'>

                <table class="table table-hover">
                    <thead>
                        <tr>
                            <th><input type="checkbox" id="checkall" name="all"></th>
                            <th></th>
                            <th><?= $this->lang->line('label_sms_order_send') ?></th>
                            <th><?= $this->lang->line('label_sms_order_msg_count') ?></th>

                            <th><?= $this->lang->line('label_sms_order_msg_cost') ?></th>

                            <th><?= $this->lang->line('label_sms_order_msg1_cost') ?></th>
                            <th><?= $this->lang->line('label_sms_order_type') ?></th>

                            <th><?= $this->lang->line('label_created_date') ?></th>
                            <th><?= $this->lang->line('label_sms_order_confirm_date') ?></th>
                        </tr>
                    </thead>
                    <tbody>
                        <?
                        foreach ($result as $value) {
                            $user_add = get_userdata_with_id($value->user_id, '*');
                            ?>
                            <tr class="gradeA">
                                <td>
                                    <?
                                    if ($value->confirm != 'YES') {
                                        ?>
                                        <input type="checkbox" class="checkall" value="<?= $value->id ?>" name="id[]">
                                        <?
                                    }
                                    ?>
                                </td>
                                <td>
                                    <a href='<?= base_url() . ADMIN_FOLDER ?>/<?= get_segment(2) ?>/view/<?= $value->id ?>'><?= $this->lang->line('label_view') ?></a>
                                </td>
                                <td>
                                    <?
                                    if ($user_add['id']) {
                                        ?>
                                        <a href='<?= base_url() . ADMIN_FOLDER ?>/users/view/<?= $user_add['id'] ?>'><?= $user_add['username'] ?></a>
                                        <?
                                    }
                                    ?>
                                </td>
                                <td>
                                    <?
                                    echo $value->msg_num;
                                    ?>
                                </td>
                                <td><?= $value->msg_cost ?>

                                </td>


                                <td><?= $value->msg1_cost ?></td>
                                <td>
                                    <? if($value->confirm == 'YES'){ ?>
                                    <span class="badge badge-success"><?= $value->confirm ?></span>
                                <?
                                    }
                                    ?>
                                 <? if($value->confirm == 'NO'){ ?>
                        <span class="badge badge-important"><?= $value->confirm ?></span>
                        <?
                                 }
                                 ?>
</td>
                        <td><?= timespan($value->create_date, time()) ?></td>
                        <td><?= timespan($value->modify_date, time()) ?></td>

                        </tr>
                    <? } ?>
                    </tbody>
                </table>

            </div>

            <div class="footer_tool_box">
                <select class="droop_tool_box" name='doaction'>
                    <option value=""><?= $this->lang->line('label_choose_fromlist') ?></option>
                    <option value="confirm"><?= $this->lang->line('label_sms_order_confirm') ?></option>
                    <option value="delete"><?= $this->lang->line('label_delete') ?></option>
                </select>
                <button class="btn btn-primary" id='execution' type="submit"><?= $this->lang->line('label_execution') ?></button>
            </div>

        </div>
    </div>

</div>

</form>



